<template>
	<view>
		<!-- <view>
			<u-tabs name="name" count="cate_count" :list="tabs" :is-scroll="false" active-color='#36c269'
				:current="current" @change="change"></u-tabs>
		</view> -->
		<view v-if="list.length!=0">
			<view class="order_bg" v-for="(item,index) in list" :key="index" @click="detail(item)">
				<view class="order_top">
					<view>订单编号：{{item.order_no}}</view>
					<image src="@/static/pay.png" class="pay_img" mode="aspectFill"></image>
				</view>
				<view class="line"></view>
				<view class="order_title">{{item.order_name}}</view>
				<view class="order_time">下单时间：{{item.create_at}}</view>
				<view class="order_message">用户信息：{{item.nickname}} <text
						style="margin-left: 30rpx;">{{item.phone || ''}}</text>
				</view>
				<view class="pay_bg">
					<view class="pay_title">已支付：<text
							style="margin-left: 16rpx;color: #03BE7A;font-size: 26rpx;">¥</text><text
							style="font-size: 44rpx;color: #03BE7A;font-weight: 800;">{{item.pay_money}}</text></view>
					<!-- <view v-if="item.status == 0" class="order_pay_btn" @click.stop="to_pay(item)">支付</view> -->
				</view>
			</view>
		</view>
		<view v-else style="text-align: center;margin-top: 60rpx;">
			<u-empty mode="data"></u-empty>
		</view>
		<view style="width: 750rpx;height: 72rpx;"></view>
		<!-- 	<u-popup v-model="pay_show" mode='bottom'  border-radius="28">
			<view class="pop_bg">
				<view class="pop_title"><text style="font-size: 32rpx;">¥</text>69.90</view>
				<view class="pop_tag">向杭州网约车助手的商户支付</view>
				<view class="line"></view>
				<view style="display: flex;align-items: center;margin-top: 56rpx;margin-left: 24rpx;">
					<view>
						<u-icon name="zhifubao-circle-fill" color="#3575EF" size="46"></u-icon>
					</view>
					<view class="pay_type_title">支付宝</view>
				</view>
			</view>
		</u-popup> -->
	</view>
</template>

<script>
	import {
		myOrder
	} from '@/api/home.js'
	export default {
		data() {
			return {
				tabs: [{
					name: '全部'
				}, {
					name: '已支付'
				}, {
					name: '未支付'
				}, ],
				list: [],
				current: 0,
				pay_show: false,
				pageSize: 30,
				pageNo: 1,
				info: {}
			};
		},
		onLoad() {
			this.getorder()
		},
		methods: {
			async getorder() {
				const {
					data
				} = await myOrder({
					pageSize: this.pageSize,
					pageNo: this.pageNo
				})
				this.list = data
			},
			change(e) {
				console.log(e)
				this.current = e
			},
			//订单详情
			detail(item) {
				let items = JSON.stringify(item)
				uni.navigateTo({
					url: 'order_det?id=' + item.id
				})
			},
			//去支付
			to_pay() {

			}
		}
	}
</script>

<style lang="scss" scoped>
	.order_bg {
		width: 702rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		padding: 30rpx 24rpx;
		margin: 0 auto;
		margin-top: 24rpx;

		.order_top {
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 30rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;

			.pay_img {
				width: 114rpx;
				height: 46rpx;
				position: absolute;
				margin-left: 575rpx;
			}
		}

		.line {
			width: 654rpx;
			height: 1rpx;
			background-color: #eeeeee;
			margin: 0 auto;
			margin-top: 22rpx;
		}

		.order_title {
			font-size: 36rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #333333;
			margin-top: 24rpx;
		}

		.order_time {
			font-size: 26rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #999999;
			margin-top: 16rpx;
		}

		.order_message {
			font-size: 26rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #999999;
			margin-top: 10rpx;
		}

		.pay_bg {
			display: flex;
			align-items: center;
			justify-content: flex-end;
			margin-top: 48rpx;

			.pay_title {
				font-size: 28rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #333333;
			}

			.order_pay_btn {
				width: 168rpx;
				height: 64rpx;
				background: #36c269;
				border-radius: 34rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 32rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
				margin-left: 40rpx;
			}
		}
	}

	.pop_bg {
		width: 750rpx;
		height: 938rpx;
		background: #FFFFFF;

		.pop_title {
			font-size: 64rpx;
			font-family: PingFang SC-Heavy, PingFang SC;
			font-weight: 800;
			color: #333333;
			text-align: center;
			margin-top: 48rpx;
		}

		.pop_tag {
			font-size: 28rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #999999;
			text-align: center;
			margin-top: 12rpx;
		}

		.line {
			width: 702rpx;
			height: 1rpx;
			background-color: #DDDDDD;
			margin: 0 auto;
			margin-top: 38rpx;
		}

		.pay_type_title {
			font-size: 30rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #333333;
			margin-left: 16rpx;
		}
	}
</style>